package com.starmark.gateway.springcloud.provider.service;

import com.starmark.gateway.springcloud.provider.dto.GatewayAppDto;
import com.starmark.gateway.springcloud.provider.dto.GatewayProjectDto;
import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.web.cors.CorsConfiguration;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.List;

public interface IRouteService {
    Flux<RouteDefinition> getRouteDefinitions();

    Mono<Void> save(Mono<RouteDefinition> routeDefinitionMono);

    Mono<Void> delete(Mono<String> routeId);

    /**
     * 获取工程信息
     * @param projectCode 工程编码
     * @return 工程信息
     */

    GatewayProjectDto getGatewayProject(String projectCode);

    /**
     * 获取工程下全部应用信息
     * @param projectCode 工程编码
     * @return 应用信息
     */
    List<GatewayAppDto> getGatewayApps(String projectCode);




    /**
     * 获取工程跨域配置信息
     * @param projectCode 工程编码
     * @return 工程配置信息
     */
    CorsConfiguration getGatewayProjectCorsConfiguration(String projectCode);
}
